<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/meta.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>教师教学资源管理系统</title>
<link rel="icon" href="${ctx}/static/images/upAndDown.jpg" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="${ctx}/static/easyui/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="${ctx}/static/easyui/themes/icon.css"/>
<link rel="stylesheet" type="text/css" href="${ctx}/static/icons/icons.css"/>

<script type="text/javascript" src="${ctx}/static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${ctx}/static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/static/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/static/js/ajaxfileupload.js"></script>
<script type="text/javascript" src="${ctx}/static/jquery-validator/jquery.validate.js"></script>
<script type="text/javascript" src="${ctx}/static/jquery-validator/jquery.validate.message_cn.js"></script>
</head>
<body>
<div class="easyui-layout" fit=true>
	<div data-options="region:'north',border:false" style="padding: 0px; ">
		<div style="padding: 0px ;background: #9FEEFB; width: auto; height: 54px;">
			<table>
				<tr valign="middle">
					<td align="left" style="width:1080px;height:50px"><font size="6px" family="宋体" >教师教学资源管理系统</font></td>
					<td><div class="datagrid-btn-separator"></div></td>
					<td align="right">当前登录者：<font color="blue">${userName}</font></td>
					<td><div class="datagrid-btn-separator"></div></td>
					<td><a href="${ctx}/user/logout" class="easyui-linkbutton" iconCls="icon-back" plain="true" tag="logout">退出登录</a></td>
		       	  	<td><div class="datagrid-btn-separator"></div></td>
				</tr>
			</table>
		</div>
	</div>
    <div data-options="region:'center',border:false" style="padding: 0px; ">
		<table fit="true" id="file_grid" fitColumns="true" rownumbers="true" 
			pageSize="25" pageList="[25,30,40]" idField="fileId"
	        toolbar="#file_toolbar" pagination="true" data-options="url:'${ctx}/view/list'">
	        <thead>
	            <tr>
	                <th data-options="field:'check' , width:100, checkbox:true" align="center"></th>
	                <th data-options="field:'fileId' , width:100" align="center">文件ID</th>
	                <th data-options="field:'fileName' , width:100" align="center">文件名</th>
	                <th data-options="field:'uploadTime' , width:100 , formatter:Hzh.formatToDateTime" align="center">上传时间</th>
	                <th data-options="field:'uploadTeacher' , width:100" align="center">上传者</th>
	                <th data-options="field:'downloadCount' , width:100" align="center">下载次数</th>
	                <th data-options="field:'fileDescription' , width:100" align="center">资源描述</th>
	                <th data-options="field:'operatorDownload',width:100,formatter:file.operatorDownload" align="center">下载</th>
	                <th data-options="field:'operatorDelete',width:100,formatter:file.operatorDelete" align="center">删除</th>
	            </tr>
	        </thead>
	    </table>
	    <div id="file_toolbar">
	      <div>
			<fieldset>
      		<legend><font color="red">登录用户及操作</font></legend>
				<table>
					<tr>
						<td><div class="datagrid-btn-separator" ${userRole == 'student'?'hidden="true"':''}></div></td>
					  <form id="uploadForm">
						<td><input type="file" name="fileNameTemp" id="fileNameTemp" style="border:1px solid black;" ${userRole == 'student'?'hidden="true"':''} /></td>
					  	<input type="text" hidden="true" name="uploadTeacher" id="uploadTeacherTemp" value="${userName}"  />
						<td ${userRole == 'student'?'hidden="true"':''}>资源描述:</td>
						<td><input type="text" name="fileDescription" id="fileDescriptionTemp" ${userRole == 'student'?'hidden="true"':''} /></td>
					  </form>
						<td ${userRole == 'student'?'hidden="true"':''}><a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-upload" plain="true" tag="upload" >上传</a></td>
			            <td><div class="datagrid-btn-separator" ${userRole == 'student'?'hidden="true"':''}></div></td>
			            <td ${userRole == 'student'?'hidden="true"':''}><a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-delete" plain="true" tag="deleteBatch" >批量删除</a></td>
		       	  		<td><div class="datagrid-btn-separator"></div></td>
		       	  	</tr>
		       	</table>
       	  	</fieldset>
	      </div>
		  <div> 
	        <fieldset>
		      <legend><font color="red">请输入查询条件</font></legend>
		      	 <table>	
		       		<tr>
		       	  		<form id="fileSearchForm">
							<td><div class="datagrid-btn-separator"></div></td>
							<td align="right">文件名:</td>
							<td><input style="width: 100px" type="text" name="searchFileName"></td>
							<td><div class="datagrid-btn-separator"></div></td>
							<td align="right">上传者:</td>
							<td><input style="width: 100px" type="text" name="searchTeacherName"></td>
							<td><div class="datagrid-btn-separator"></div></td>
							<td align="right">文件描述:</td>
							<td><input style="width: 100px" type="text" name="searchFileDescription"></td>
							<td><div class="datagrid-btn-separator"></div></td>
							<td align="right">上传时间:</td>
							<td><input name="startTime" type="text" style="width: 120px;" class="Wdate" id="uploadStartTime" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'uploadEndTime\',{d:0})||\'%y-%M-%d\'}'})"></td>
							<td align="center"><span>----></span></td>
							<td><input name="endTime" type="text" style="width: 120px;" class="Wdate" id="uploadEndTime" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'uploadStartTime\',{d:1})}'})"></td>
							<td><div class="datagrid-btn-separator"></div></td>
				            <td><a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search1" plain="true" tag="query">查询</a></td>
				            <td><div class="datagrid-btn-separator"></div></td>
				            <td><a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-clear1" plain="true" tag="clear">清空查询</a></td>
				            <td><div class="datagrid-btn-separator"></div></td>
						</form>
		       	  	</tr>
		       	 </table>
		  	</fieldset>
		  </div>
	    </div>
	</div>
</div>
<script type="text/javascript">
	var file = {};
	var userRole = "${userRole}";
</script>
<script type="text/javascript" src="${ctx}/static/js/file/file.js"></script>
</body>
</html>